@import "normalize.css";
$color1: #02335b; //深蓝
$color2: #95d800; //橙色
$color3: #eaeaea; //灰色
$color4: #446a89;
%oneline {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.background {}

body {
  background-color: $color3;
  position: relative;
}

h2 {
  margin: 0;
}

a {
  text-decoration: none;
}

header {
  z-index: 999;
  position: fixed;
  width: 100%;
  box-shadow: 0 1px 2px rgba(black, .2);
}


/* header01 */

@media screen and (max-width:820px) {
  .header01 {
    flex-flow: column;
    justify-content: center;
    height: 90px !important;
    .right {
      justify-content: flex-end;
    }
  }
}

.header01 {
  display: flex;
  justify-content: space-between;
  height: 45px;
  background-image: url(../img/headerbg.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  padding:0 2%;
}

.header01 {
  .left {
    display: flex;
    .icon {
      height: 45px;
      width: 64px;
      background-image: url(../img/icon.png);
      background-repeat: no-repeat;
      background-position: center center;
      border-right: 1px solid #0a5f8e;
    }
    h2 {
      font-size: 22px;
      font-family: "Microsoft Yahei";
      font-weight: normal;
      color: white;
      text-shadow: 2px 2px 2px rgba(black, .65);
      margin: auto;
      padding-left: 15px;
      line-height: 45px;
      @extend %oneline;
    }
  }
}

.header01 {
  .right {
    display: flex;
    @extend %oneline;
    a {
      color: white;
      font-size: 12px;
    }
    &>* {
      margin: auto 8px;
      background-repeat: no-repeat;
      background-position: left center;
      padding-left: 20px;
    }
    .message {
      width: 60px;
      background-image: url(../img/header-icon01.png);
      background-position: center center;
      text-align: center;
      padding-left: 0;
      a {
        height: 45px;
        width: 60px;
        //padding-right: 20px;
        display: inline-block;
        position: relative;
        &:hover {
          background-color: rgba(white, .2);
        }
        span {
          color: $color1;
          border-radius: 10px;
          font-size: 10px;
          background-color: $color2;
          position: absolute;
          right: 8px;
          top: 5px;
          padding: 1px 5px;
        }
      }
    }
    .login-in {
      //width: 120px;
      background-image: url(../img/header-icon02.png);
      text-align: right;
      .name,
      .exit {
        height: 45px;
        display: inline-block;
        line-height: 45px;
        padding: 0 5px;
        &:hover {
          color: $color2;
        }
      }
      span {
        font-size: 10px;
        color: white;
      }
      .name {}
      .exit {}
    }
    .cslnnet {
      margin-right: 0;
      padding:0;
      a {
        display: inline-block;
        height: 45px;
        width:107px;
        background:url(../img/cslnlogocell_jpg.gif) no-repeat;
        background-size: contain;
      }
    }
    .backtohome {
      background-image: url(../img/header-icon03.png);
      //width: 72px;
    }
    .backtohome {
      text-align: right;
      //margin-right: 20px;
      a {
        display: inline-block;
        height: 45px;
        line-height: 45px;
        &:hover {
          color: $color2;
        }
      }
    }
  }
}


/* header02 */

@media screen and (min-width:1045px) and (max-width:1360px) {
  .data-list {
    margin-top: -4px !important;
    .data {
      display: flex;
      flex-flow: column;
    }
  }
}

@media screen and (max-width:1044px) {
  .header02 {
    flex-flow: column;
    height: auto !important;
  }
  .data-list {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    margin: 0 !important;
    .data {
      margin: 0 16px !important;
    }
  }
}

.header02 {
  height: 30px;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  background-color: white;
}

.custommenus {
  font-size: 12px;
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  //width:600px
  height:inherit;
  &:hover .custommenulist {
    //overflow: visible;
    //margin-left: 0;
    //height: auto;
  }
  .custommenusbutton,
  a,
  span {
    display: block;
    min-height: 30px;
    line-height: 30px;
  }
  .custommenusbutton {
    background: url(../img/custommenus.png) no-repeat center center;
    min-width: 64px;
    /*&:hover {
      background-color: $color2;
    }*/
  }
  .custommenulist {
    display: flex;
    flex-flow: row wrap;
    overflow: hidden;
    height:30px;
    position: absolute;
    left: 64px;
    max-width: 75vw;
    //padding-left: 10px;
    background-color:white;
  }
  a {
    color: $color1;
    //padding-left: 15px;
    padding-right: 14px;
    //display:none;
    background-color: white;
    &:first-child{
      padding-left: 15px;
    }
    &:hover {
      color: $color2;
    }
  }
  a+a {
    &:before {
      content: "|";
      color: rgba($color1, .5) !important;
      margin-right: 14px;
    }
  }
  
  .aclass{
    &:before {
      content: "";
      color: rgba($color1, .5) !important;
      margin-right: 14px;
    }
  }
}

.historylink {
  .link-menu {
    position: relative;
    &:hover .menu-list {
      height: auto;
      padding: 10px 0;
      opacity: 1;
    }
    .menu-name {
      //border: 1px solid #bdbdbd;
      //border-radius: 4px;
      background-color: white;
      font-size: 12px;
      height: 30px;
      width: 80px;
      line-height: 30px;
      padding: 0 40px 0 15px;
      position: relative;
      cursor: pointer;
      &:hover {
        color: $color2;
      }
      &:after {
        content: "";
        background: url(../img/menudown.png) no-repeat center right;
        width: 26px;
        height: 26px;
        display: block;
        position: absolute;
        right: 25px;
        top: 0;
      }
    }
    .menu-list {
      position: absolute;
      border: 1px solid #bdbdbd;
      background-color: #f2f2f2;
      font-size: 12px;
      width: 133px; //161px
      opacity: 0;
      overflow: hidden;
      height: 0;
      top: 30px;
      transition: all .2s linear;
      .subnavlink {
        padding: 5px 0;
        padding-left: 15px;
        color: #02335b;
        display: block;
        @extend %oneline;
        &:hover {
          background-color: rgba(white, .8);
        }
      }
    }
  }
}


/* leftnav */

@media screen and (min-width:821px) and (max-width:1044px) {
  nav {
    top: 104px !important;
  }
  .wrapper {
    padding-top: 104px !important;
  }
}

@media screen and (min-width:573px) and (max-width: 820px) {
  nav {
    top: 164px !important;
  }
  .wrapper {
    padding-top: 164px !important;
  }
}

@media screen and (max-width:572px) {
  nav {
    top: 199px !important;
  }
  .wrapper {
    padding-top: 199px !important;
  }
}

nav {
  position: fixed;
  height: 100%;
  background-color: #02335b;
  //padding-top: 22px;
  top: 75px;
  &:before {
    content: "";
    display: block;
    width: 64px;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: #02335b;
  }
  .leftnav {
    position: relative;
  }
  .navlist {
    //min-height: 94vh;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .navitem {
    position: relative;
    &:hover {
      background-color: #537fa3;
    }
  }
  .iconlink {
    display: inline-block;
    height: 64px;
    width: 64px;
  }
  @for $i from 0 to 6 {
    .icon#{$i + 1} .iconlink {
      background: url(../img/leftbar.png) no-repeat (- ($i * 64px)) 0;
    }
    .icon#{$i + 1} .active {
      background: url(../img/leftbar.png) no-repeat (- ($i * 64px)) -64px;
    }
  }
  .icon1 .subnav,
  .icon2 .subnav {
    width: 124px;
    padding: 0;
    .headertitle {
      padding: 0;
      height: 67px;
      line-height: 67px;
    }
  }
  .icon3 .subnav {
    top: -134px;
  }
  .icon4 .subnav,
  .icon5 .subnav {
    bottom: 0;
  }
  .icon6 .subnav {
    bottom: -19px;
  }
  .subnav {
    position: absolute;
    left: 64px;
    width: 124px; // *4
    display: none;
    background-color: #537fa3;
    color: white;
    padding: 10px 0;
    .headertitle {
      font-family: "Microsoft Yahei";
      font-weight: bold;
      font-size: 16px;
      display: block;
      padding: 10px;
      padding-left: 20px;
    }
    .subnav-list {
      display: flex;
      flex-flow: column wrap; //row
    }
    .linking {
      color: $color2!important;
    }
    .subnavlink {
      display: block;
      color: white;
      font-size: 12px;
      //width: 100%;
      padding: 10px;
      padding-left: 20px;
      box-sizing: border-box;
      &:hover {
        border-left: 3px solid $color2; //bottom
        padding-left: 17px; //bottom
        background-color: rgba(white, .2);
      }
    }
  }
}


/* wrapper */

.wrapper {
  display: flex; //none
  padding-top: 70px;
  .left {}
  .right {
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-flow: column;
    padding-left: 64px;
    //margin-left: -64px;
    //margin-top: 5px;
    box-sizing: border-box;
  }
}


/*footer*/

footer {
  //background-color: orange; //testcolor
  //height: 60px;
  box-sizing: border-box;
  margin-top: 40px;
  text-align: center;
  padding: 10px;
  .footerlink {
    ul {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-flow: row wrap;
      justify-content: center;
      li {
        margin: 8px 12px;
      }
      a {
        color: #666666;
        font-size: 12px;
        padding: 5px;
      }
    }
  }
  .copyright {
    font-family: "Arial";
    font-size: 12px;
    color: #999999;
  }
}


/*section*/

section {
  box-sizing: border-box;
  padding: 20px;
  text-align: justify;
  line-height: 1.5;
}

.title-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  //background-color:orange; //test
  color: #02335b;
  .title {
    font-family: "Microsoft Yahei";
    h2 {
      font-weight: normal;
      font-size: 20px;
      //vertical-align: middle;
      display: inline-block;
      &:before {
        content: "";
        background: url(../img/h2icon.png) no-repeat left 1px;
        width: 30px;
        height: 25px;
        display: inline-block;
        vertical-align: middle;
      }
    }
    span {
      font-weight: bold;
      font-size: 16px;
    }
  }
  .menu {
    position: relative;
    &:hover .subnav-list {
      height: auto;
      opacity: 1;
      top: 0;
      transition: all .2s linear;
      padding: 10px 0;
    }
    .menulist {
      border: 1px solid #bdbdbd;
      //border-radius: 4px;
      background-color: white;
      font-size: 12px;
      height: 26px;
      width: 106px;
      line-height: 26px;
      padding: 0 40px 0 15px;
      position: relative;
      cursor: pointer;
      &:before {
        content: "";
        background: url(../img/menu.png) no-repeat center left;
        width: 26px;
        height: 26px;
        display: block;
        position: absolute;
        left: -36px;
      }
      &:after {
        content: "";
        background: url(../img/menudown.png) no-repeat center right;
        width: 26px;
        height: 26px;
        display: block;
        position: absolute;
        right: 8px;
        top: 0;
      }
    }
    .subnav-list {
      position: absolute;
      width: inherit;
      border: 1px solid #bdbdbd;
      background-color: #f2f2f2;
      font-size: 12px;
      width: 197px; //161px
      left: -36px;
      height: 0;
      opacity: 0;
      overflow: hidden;
      top: 30px;
      .linking {
        color: red !important;
      }
      .subnavlink {
        padding: 5px 0;
        padding-left: 15px;
        color: #02335b;
        display: block;
        @extend %oneline;
        &:hover {
          background-color: rgba(white, .8);
        }
        &:before {
          content: "|";
          padding-right: 10px
        }
      }
    }
  }
}


/* loading */

$loadingsize:50px;
.loading {
  position: fixed;
  width: $loadingsize;
  height: $loadingsize;
  left: 50%;
  top: 40%;
  //margin-top: - $loadingsize;
  margin-left: -($loadingsize / 2 -64);
  animation: rotates 1s linear infinite;
  img {
    display: inline-block;
    width: 100%;
    opacity: .5;
  }
  @keyframes rotates {
    from {
      transform: rotate(0);
    }
    to {
      transform: rotate(360deg);
    }
  }
}


/* backtotop */

#backtotop {
  width: 64px;
  height: 50px;
  cursor: pointer;
  display: none;
  position: fixed;
  left: 0;
  bottom: 60px;
  text-align: center;
  background: url(../img/backtotop.png) $color3 no-repeat center center;
  background-size: 80%;
  &:hover {
    animation: totop 1.5s infinite linear;
    //animation-fill-mode: backwards;
  }
  @keyframes totop {
    from {
      background-position: center 15px;
    }
    to {
      background-position: center -15px;
    }
  }
}


/*表格通用样式*/

%tablenormal {
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    a {
      color: inherit;
      display: block;
      width: 100%;
      height: 32px;
      line-height: 32px;
      @extend %oneline;
      padding: 0 5px;
      box-sizing: border-box;
      &:hover {
        background-color: rgba(#dfdfdf, .8);
      }
    }
    th,
    td {
      border: 1px solid #dfdfdf;
    }
    thead {
      border-bottom: 2px solid #dfdfdf;
      background-color: #fafafa;
      color: #02335b;
      text-align: center;
      tr {
        height: 30px;
      }
    }
    tbody {
      background-color: white;
      color: #333;
      tr {
        height: 30px;
      }
      td {
        padding: 0 5px;
      }
    }
  }
}


/* 通用按钮样式 */

%button {
  font-family: "Microsoft Yahei";
  text-align: center;
  font-size: 1.2em;
  padding: 5px 30px;
  cursor: pointer;
  background-color: $color1;
  color: white;
  border: 2px solid white;
  outline: none;
  box-shadow: 1px 1px 3px rgba(black, .4);
  margin: 0 20px;
  &:active {
    background-color: white;
    border: 2px solid $color1;
    color: $color1;
  }
}

.button {
  text-align: right;
  margin-top: 20px;
  .download {
    @extend %button;
  }
  .rank {
    @extend %button;
  }
}


/* 报表与统计-基本情况 */

.unionreport {
  @extend %tablenormal;
  table {
    thead {
      tr {
        &:nth-of-type(2) {
          background-color: #f2f2f2;
        }
      }
    }
    tbody {
      tr {
        &:nth-last-child(2),
        &:last-child {
          font-weight: bold;
          background-color: #fafafa;
          td:first-of-type {
            padding: 0 5px;
          }
        }
        &:nth-last-child(2) {
          border-top: 2px solid #dfdfdf;
        }
      }
      td {
        text-align: right;
        &:first-of-type {
          text-align: left;
        }
        &:nth-of-type(2) {
          text-align: center;
        }
        &:first-child {
          padding: 0;
        }
      }
    }
  }
}


/* 图书馆管理 */

.memberlist {
  @extend %tablenormal;
  thead {
    tr {
      height: 60px!important;
    }
  }
  tbody {
    td:nth-of-type(1),
    td:nth-of-type(2) {
      padding: 0;
    }
    td:nth-of-type(1) {
      text-align: center;
    }
    td:nth-last-child(1) {
      text-align: center;
    }
    td:nth-last-child(2),
    td:nth-last-child(3) {
      text-align: right;
    }
  }
}
